Latest update: November 2018
This tutorial will explain the IFTTT linkage function used by the FlashAir IoT Hub.
For basic usage of IFTTT and IFTTT linkage, please see Trigger version.
Please prepare to be able to connect your FlashAir to the FlashAir IoT Hub in advance referencing the flow of usage steps.
To enable FlashAir's GPIO function, edit
/SD_WLAN/CONFIG
in FlashAir and add
IFMODE=1
.
It is always a good idea to read through the tutorial after confirming that FlashAir is online.
Let's try to get our LED to flicker with IFTTT linkage using the GPIO function of FlashAir IoT Hub.
To use FlashAir's GPIO function, use Airio RP which is a prototyping board of FlashAir.
For Airio RP, refer to FlashAir prototyping board "Airio RP".
For details of GPIO function, please refer to here.
Configure Webhook on FlashAir IoT Hub.
Let's click "Set WebHook" at action of FlashAir IoT Hub > GPIO output.
Click "Enable".
Please note the value of the key displayed on the page. It is used for making the Webhook.
Next, let's make an Applet that displays graphs on FlashAir IoT Hub on the IFTTT My Applets page.
Click "New Applet" and click "this" part.
Search "Webhooks" and click the icon.
Click "Receive a web request".
Enter Event Name to identify Webhook and click "Create trigger".
Then click "that" part.
Search "Webhooks" and click the icon.
Enter the value created here in the displayed dialog and click "Create action".
When you click "Finish", IFTTT setting is completed.
Insert FlashAir into Airio RP, insert Micro USB cable connected to a power supply and start up.
After starting up and after confirming that the LED of the Airio RP turns off, it is ready.
Let's display the graph on the FlashAir IoT Hub from the created Applet.
Log in to IFTTT, open the Webhooks page and click "Documentation".
In {event}
, enter the Event Name (example: flashair) entered when creating the Applet and click "Test It".
Now that we are ready, let's run it.
I think whether you can confirm that the LED of Airio RP turns on by pressing "Test It".
If you change the "data":
in the Body part from 2
to 1
and then execute Applet again, the LED goes out.
Next, let's call the Lua script in FlashAir from IFTTT and execute it. FlashAir Set with IoT Hub and IFTTT.
Configure Webhook on FlashAir IoT Hub.
FlashAir IoT Hub action > Click "Set WebHook" at the script execution place.
If the Webhook setting has already been activated, the content to be entered in the action field is displayed with it entered. If you have not enabled Webhook settings, please click "Enable".
Write down the value displayed on the page. It is used for making Webhook.
I will create an Applet just like here.
Please enter the value created above in Complete action fields.
/echo.lua
in the body is a script that displays measured values. For details, please click here.
Let's check whether the measured value is actually transmitted.
Let's call the created Applet like this.
Script execution tasks are displayed on jobs waiting to be processed. If the status does not change and remains unchanged, please check that FlashAir is online. Let's display the trigger > measured value graph when the status has been executed.
A graph is displayed each time "Test It" is pressed.
By modifying the red part of Body according to your environment, it can be applied to various forms.
With FlashAir IoT Hub and IFTTT, IFTTT was able to call data on FlashAir in cooperation with Web services.
This time I updated the FlashAir IoT Hub from the outside using IFTTT, but it is possible to collaborate if it is a Web service that can set a Webhook.
Operate the lua script in the FlashAir from the outside, display the graph of the measured value, when rain falls, the Airio RP LED will flicker and announce it to you! Now you're free to think up various other methods of using this type of functionality.